import { markRaw } from 'vue';
import { RouteRecordRaw } from 'vue-router';
import RouterTransition from '@/components/routerTransition.vue';

const routeName = 'warehouse';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/warehouse',
        name: routeName,
        redirect: '/warehouse/prod',
        component: markRaw(RouterTransition),
        meta: {
            title: 'yl.warehouseMgt',
            icon: 'ReconciliationOutlined',
        },
        children: [
            {
                path: 'prod',
                name: `${routeName}-prod`,
                meta: {
                    title: 'yl.prodBatch',
                    icon: 'go-on',
                },
                component: () => import(/* webpackChunkName: "warehouse" */ '@/views/warehouse/production/index.vue'),
            },

            {
                path: 'account',
                name: `${routeName}-account`,
                meta: {
                    title: 'yl.mqAccount',
                    icon: 'open-an-account',
                },
                component: () => import(/* webpackChunkName: "warehouse" */ '@/views/warehouse/account/index.vue'),
            },
            {
                path: 'model',
                name: `${routeName}-model`,
                meta: {
                    title: 'yl.model',
                    icon: 'transfer',
                },
                component: () => import(/* webpackChunkName: "warehouse" */ '@/views/warehouse/model/index.vue'),
            },
            {
                path: 'recovery',
                name: `${routeName}-recovery`,
                meta: {
                    title: 'yl.equipmentRecovery',
                    icon: 'recycle-bin',
                },
                component: () => import(/* webpackChunkName: "warehouse" */ '@/views/warehouse/recovery/index.vue'),
            },
        ],
    },
];

export default routes;
